//
//  LLT_LiveBigTableViewCell_LXH.m
//  CoderLLT
//
//  Created by lanou3g on 15/12/14.
//  Copyright © 2015年 刘晓萌. All rights reserved.
//

#import "LLT_LiveBigTableViewCell_LXH.h"
#import "LLT_LiveModel.h"
#import "UIImageView+WebCache.h"

@interface LLT_LiveBigTableViewCell_LXH()

@property (weak, nonatomic) IBOutlet UIImageView *liveImageView;
@property (weak, nonatomic) IBOutlet UILabel *liveTitleLabel;

@property (weak, nonatomic) IBOutlet UIImageView *liveUserImageView;
@property (weak, nonatomic) IBOutlet UILabel *liveUserNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *liveCountsLabel;

@end

@implementation LLT_LiveBigTableViewCell_LXH


/**
 * 销毁
 */
-(void)dealloc{
    
    self.liveModel = nil;
    self.liveImageView = nil;
    self.liveTitleLabel = nil;
    self.liveUserImageView = nil;
    self.liveUserNameLabel = nil;
    self.liveCountsLabel = nil;
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


/**
 * 设置model
 */
-(void)setLiveModel:(LLT_LiveModel *)liveModel{
    
    if (_liveModel != liveModel) {
        _liveModel = nil;
        _liveModel = liveModel;
    }
    [self setLiveWithModel];
}

/**
 * 设置cell上视图的值
 */
-(void)setLiveWithModel{
    
    [self.liveImageView sd_setImageWithURL:[NSURL URLWithString:self.liveModel.live_img]placeholderImage:[UIImage imageNamed:@"placeHolder"]];
    
    self.liveTitleLabel.text = [NSString stringWithFormat:@"%@",self.liveModel.live_title];
    
    self.liveUserNameLabel.text = [NSString stringWithFormat:@"%@",self.liveModel.live_nickname];
    
    [self.liveUserImageView sd_setImageWithURL:[NSURL URLWithString:self.liveModel.live_userimg]placeholderImage:[UIImage imageNamed:@"mhead"]];
    
    self.liveCountsLabel.text = [NSString stringWithFormat:@"%@名观众",self.liveModel.live_online];
    
    
}





@end
